import http from "../utils/request";

import { CreateMeetingRoom, UpdateMeetingRoom } from "../pages/meeting-room/MeetRoomAdd&Edit";

export const meetingRoomList = (name: string, capacity: number, equipment: string, pageNo: number, pageSize: number)=> {
    return http.get("/meeting-room/list", {
        params: {
            name,
            capacity,
            equipment,
            pageNo,
            pageSize
        }
    });
}

export const deleteMeetingRoom = (id: number)=>{
    return http.delete("/meeting-room/"+id);
}

export const createMeetingRoom = (meetingRoom: CreateMeetingRoom)=>{    
    return http.post("/meeting-room/create", meetingRoom);
}

export const findMeetingRoom = (id: number)=>{
    return http.get("/meeting-room/"+id);
}

export async function updateMeetingRoom(meetingRoom: UpdateMeetingRoom) {
    return await http.put('/meeting-room/update', meetingRoom);
}